import request from '@/utils/request'

/**
 * 1. 获取文章列表
 * @param {current, pageSize} data
 * @returns
 */
export const getArticleListApi = (data) => {
  return request.get('/admin/interview/query', {
    params: data
  })
}

// 2.添加文章
export const createArticleApi = (data) => {
  return request.post('/admin/interview/create', data)
}

// 3.删除文章
export const removeArticleApi = (id) => {
  return request.delete('/admin/interview/remove', {
    data: {
      id
    }
  })
}

/**
 * 4. 根据id获取面经详情
 * @param {*} id
 * @returns
 */
export const getArticleDetailApi = (id) => {
  return request.get('/admin/interview/show', {
    params: {
      id
    }
  })
}

/**
 * 5. 修改文章
 * @param {id, stem, content} data
 * @returns
 */
export const updateArticleApi = (data) => {
  return request.put('/admin/interview/update', data)
}
